import Vue from 'vue'
import VueRouter from 'vue-router'

const CreateArticle = () =>
  import ('../views/CreateArticle.vue')

const ListArticle = () =>
  import ('../views/ListArticle.vue')


Vue.use(VueRouter)

const routes = [
  { path: '/', name: 'home', redirect: '/articles/index' },
  { path: '/articles/create', name: 'create-article', component: CreateArticle },
  { path: '/articles/index', name: 'list-article', component: ListArticle },
]

const router = new VueRouter({
  routes,
  mode: 'history'
})

export default router